package xls;

import com.google.common.io.Files;
import org.assertj.core.util.Lists;
import org.eclipse.paho.client.mqttv3.util.Strings;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;

/**
 * Created by gulx@neusoft.com on 2017/9/25.
 */
public class Dafen {
    public static  List<String> bankai(String fileUri) throws IOException {
        List<String> lines =  Files.readLines(new java.io.File(fileUri), Charset.forName("UTF-8"));
        List<String> newLines = Lists.newArrayList();
        lines.stream()
             .filter(e -> !Strings.isEmpty(e))
             .forEach(e -> newLines.add(e));
        return newLines;
    }

    public static void  output(List<String> list) throws IOException {
        list.forEach(e -> {
            System.out.println(e);
        });

    }

    public static void main(String[] args) throws IOException {
        List<String> list =  bankai("E:\\WorkFolder\\项目\\case\\2017\\网安架构\\jinzh.txt");
        output(list);
//        List<String> list =  bankai("E:\\WorkFolder\\项目\\case\\2017\\网安架构\\jinzh.txt");
//        output(list);
//        List<String> list =  bankai("E:\\WorkFolder\\项目\\case\\2017\\网安架构\\wangsj.txt");
//        output(list);
//        List<String> list =  bankai("E:\\WorkFolder\\项目\\case\\2017\\网安架构\\kuangbx.txt");
//        output(list);
    }
}
